#include <bits/stdc++.h>
using namespace std;
#define int long long

int n, m, k, dp[100005], dep[100005], fa[100005];
bool isp[100005], vis[100005];
vector<int> edges[100005];
vector<pair<int, int>> res;

void dfs(int i) {
	vis[i] = 1;
	int lst = 0;
	for (auto j : edges[i]) {
		if (vis[j]) continue;
		fa[j] = i;
		dep[j] = dep[i] + 1;
		dfs(j);
		int t = dp[j];
		if (t == 0) continue;
		if (lst == 0) {
			lst = t;
		} else {
			res.push_back({t, lst});
			lst = 0;
		}
	}
	if (isp[i]) {
		if (lst) {
			res.push_back({i, lst});
		} else dp[i] = i;
	} else {
		if (lst) {
			dp[i] = lst;
		} else dp[i] = 0;
	}
}

signed main() {
	freopen("travel.in", "r", stdin); freopen("travel.out", "w", stdout);
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> n >> m >> k;
	while (m--) {
		int u, v;
		cin >> u >> v;
		edges[u].push_back(v);
		edges[v].push_back(u);
	}
	for (int i = 1; i <= k; ++i) {
		int x;
		cin >> x;
		isp[x] = 1;
	}
	for (int i = 1; i <= n; ++i) {
		if (!vis[i]) {
			dfs(i);
		}
	}
	cout << res.size() << "\n";
	for (auto i : res) {
		int u = i.first, v = i.second;
		//cout << u << " " << v << "\n";
		vector<int> ls, rs;
		while (u != v) {
			if (dep[u] > dep[v]) {
				ls.push_back(u);
				u = fa[u];
			} else {
				rs.push_back(v);
				v = fa[v];
			}
		}
		cout << ls.size() + rs.size() + 1 << " ";
		for (auto i : ls) cout << i << " ";
		cout << u << " ";
		reverse(rs.begin(), rs.end());
		for (auto j : rs) cout << j << " ";
		cout << "\n";
	}
	return 0;
}
